<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>珠峰架构师成长计划</title>
    <link rel="stylesheet" type="text/css" href="../static/css/main.css">
</head>
<body>
<div class="nav">
    <div class="logo">
        
            珠峰架构师成长计划
        
    </div>
<ul><li><a href="../index.html">0.Async</a></li><li><a href="../html/0.editor.html">0.editor</a></li><li><a href="../html/0.module.html">0.module</a></li><li><a href="../html/1.ES2015.html">1.ES2015</a></li><li><a href="../html/2.Promise.html">2.Promise</a></li><li><a href="../html/3.Node.html">3.Node</a></li><li><a href="../html/4.NodeInstall.html">4.NodeInstall</a></li><li><a href="../html/5.REPL.html">5.REPL</a></li><li><a href="../html/6.NodeCore.html">6.NodeCore</a></li><li><a href="../html/7.module&NPM.html">7.module&NPM</a></li><li><a href="../html/8.Encoding.html">8.Encoding</a></li><li><a href="../html/9.Buffer.html">9.Buffer</a></li><li><a href="../html/10.fs.html">10.fs</a></li><li><a href="../html/11.Stream-1.html">11.Stream-1</a></li><li><a href="../html/11.Stream-2.html">11.Stream-2</a></li><li><a href="../html/11.Stream-3.html">11.Stream-3</a></li><li><a href="../html/11.Stream-4.html">11.Stream-4</a></li><li><a href="../html/12-Network-2.html">12-Network-2</a></li><li><a href="../html/12.NetWork-3.html">12.NetWork-3</a></li><li><a href="../html/12.Network-1.html">12.Network-1</a></li><li><a href="../html/13.tcp.html">13.tcp</a></li><li><a href="../html/14.http-1.html">14.http-1</a></li><li><a href="../html/14.http-2.html">14.http-2</a></li><li><a href="../html/15.compress.html">15.compress</a></li><li><a href="../html/16.crypto.html">16.crypto</a></li><li><a href="../html/17.process.html">17.process</a></li><li><a href="../html/18.yargs.html">18.yargs</a></li><li><a href="../html/19.cache.html">19.cache</a></li><li><a href="../html/20.action.html">20.action</a></li><li><a href="../html/21.https.html">21.https</a></li><li><a href="../html/22.cookie.html">22.cookie</a></li><li><a href="../html/23.session.html">23.session</a></li><li><a href="../html/24.express-1.html">24.express-1</a></li><li><a href="../html/24.express-2.html">24.express-2</a></li><li><a href="../html/24.express-3.html">24.express-3</a></li><li><a href="../html/24.express-4.html">24.express-4</a></li><li><a href="../html/25.koa-1.html">25.koa-1</a></li><li><a href="../html/26.webpack-1-basic.html">26.webpack-1-basic</a></li><li><a href="../html/26.webpack-2-optimize.html">26.webpack-2-optimize</a></li><li><a href="../html/26.webpack-3.tapable.html">26.webpack-3.tapable</a></li><li><a href="../html/26.webpack-4-AST.html">26.webpack-4-AST</a></li><li><a href="../html/26.webpack-5-source.html">26.webpack-5-source</a></li><li><a href="../html/26.webpack-6-loader.html">26.webpack-6-loader</a></li><li><a href="../html/26.webpack-7-plugin.html">26.webpack-7-plugin</a></li><li><a href="../html/26.webpack-8-hand.html">26.webpack-8-hand</a></li><li><a href="../html/27.react-1.html">27.react-1</a></li><li><a href="../html/27.react-2.html">27.react-2</a></li><li><a href="../html/27.react-3.html">27.react-3</a></li><li><a href="../html/27.react-4-immutable.html">27.react-4-immutable</a></li><li><a href="../html/27.react-5-react-dom-diff.html">27.react-5-react-dom-diff</a></li><li><a href="../html/27.react-6.html">27.react-6</a></li><li><a href="../html/28.react-mobx.html">28.react-mobx</a></li><li><a href="../html/28.redux-0.html">28.redux-0</a></li><li><a href="../html/28.redux-1.html">28.redux-1</a></li><li><a href="../html/28.redux-2-中间件.html">28.redux-2-中间件</a></li><li><a href="../html/28.redux-3-saga.html">28.redux-3-saga</a></li><li><a href="../html/28.redux-jwt-back.html">28.redux-jwt-back</a></li><li><a href="../html/28.redux-jwt-front.html">28.redux-jwt-front</a></li><li><a href="../html/29.mongodb-1.html">29.mongodb-1</a></li><li><a href="../html/29.mongodb-2.html">29.mongodb-2</a></li><li><a href="../html/29.mongodb-3.html">29.mongodb-3</a></li><li><a href="../html/29.mongodb-4.html">29.mongodb-4</a></li><li><a href="../html/29.mongodb-5.html">29.mongodb-5</a></li><li><a href="../html/29.mongodb-6.html">29.mongodb-6</a></li><li><a href="../html/30.cms-1-mysql.html">30.cms-1-mysql</a></li><li><a href="../html/30.cms-2-mysql.html">30.cms-2-mysql</a></li><li><a href="../html/30.cms-3-mysql.html">30.cms-3-mysql</a></li><li><a href="../html/30.cms-4-egg.html">30.cms-4-egg</a></li><li><a href="../html/30.cms-5-api.html">30.cms-5-api</a></li><li><a href="../html/30.cms-6-roadhog.html">30.cms-6-roadhog</a></li><li><a href="../html/30.cms-7-umi.html">30.cms-7-umi</a></li><li><a href="../html/30.cms-8-dva.html">30.cms-8-dva</a></li><li><a href="../html/30.cms-9-dva.html">30.cms-9-dva</a></li><li><a href="../html/30.cms-10-front.html">30.cms-10-front</a></li><li><a href="../html/30.cms-11-deploy.html">30.cms-11-deploy</a></li><li><a href="../html/33.redis.html">33.redis</a></li><li><a href="../html/34.unittest.html">34.unittest</a></li><li><a href="../html/35.jwt.html">35.jwt</a></li><li><a href="../html/36.websocket-1.html">36.websocket-1</a></li><li><a href="../html/36.websocket-2.html">36.websocket-2</a></li><li><a href="../html/38.chat-api-1.html">38.chat-api-1</a></li><li><a href="../html/38.chat-api-2.html">38.chat-api-2</a></li><li><a href="../html/38.chat-3.html">38.chat-3</a></li><li><a href="../html/38.chat-api-3.html">38.chat-api-3</a></li><li><a href="../html/38.chat.html">38.chat</a></li><li><a href="../html/38.chat2.html">38.chat2</a></li><li><a href="../html/38.chat2.html">38.chat2</a></li><li><a href="../html/39.crawl-0.html">39.crawl-0</a></li><li><a href="../html/39.crawl-1.html">39.crawl-1</a></li><li><a href="../html/39.crawl-2.html">39.crawl-2</a></li><li><a href="../html/40.deploy.html">40.deploy</a></li><li><a href="../html/41.safe.html">41.safe</a></li><li><a href="../html/42.test.html">42.test</a></li><li><a href="../html/43.nginx.html">43.nginx</a></li><li><a href="../html/44.enzyme.html">44.enzyme</a></li><li><a href="../html/45.docker.html">45.docker</a></li><li><a href="../html/46.elastic.html">46.elastic</a></li><li><a href="../html/47.oauth.html">47.oauth</a></li><li><a href="../html/48.wxpay.html">48.wxpay</a></li><li><a href="../html/49.nunjucks.html">49.nunjucks</a></li><li><a href="../html/50.ketang.html">50.ketang</a></li><li><a href="../html/index.html">index</a></li><li><a href="../html/51.typescript.html">51.typescript</a></li><li><a href="../html/52.UML.html">52.UML</a></li><li><a href="../html/53.design.html">53.design</a></li><li><a href="../html/index.html">index</a></li><li><a href="../html/54.linux.html">54.linux</a></li><li class="active"><a href="../html/55.yaml.html">55.yaml</a></li><li><a href="../html/50.ketang2.html">50.ketang2</a></li><li><a href="../html/56.ts.html">56.ts</a></li><li><a href="../html/57.ts_react.html">57.ts_react</a></li><li><a href="../html/58.react-ssr.html">58.react-ssr</a></li><li><a href="../html/59.react-ssr.html">59.react-ssr</a></li></ul></div>


<div class="warpper">

    <div class="page-toc">
        <ul><li><a href="#t01.YAML">1.YAML</a></li><li><a href="#t12.基本规则">2.基本规则</a></li><li><a href="#t23. YAML 支持的数据结构">3. YAML 支持的数据结构</a><ul><li><a href="#t33.1 对象">3.1 对象</a></li><li><a href="#t43.2 数组">3.2 数组</a></li><li><a href="#t53.3 复合结构">3.3 复合结构</a></li><li><a href="#t63.4 纯量">3.4 纯量</a></li></ul></li><li><a href="#t7参考">参考</a></li></ul>
    </div>
    
    <div class="content markdown-body">
        <h2 id="t01.YAML">1.YAML <a href="#t01.YAML"> # </a></h2>
<p>YAML &#x662F;&#x4E13;&#x95E8;&#x7528;&#x6765;&#x5199;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x8BED;&#x8A00;</p>
<h2 id="t12.&#x57FA;&#x672C;&#x89C4;&#x5219;">2.&#x57FA;&#x672C;&#x89C4;&#x5219; <a href="#t12.&#x57FA;&#x672C;&#x89C4;&#x5219;"> # </a></h2>
<ul>
<li>&#x5927;&#x5C0F;&#x5199;&#x654F;&#x611F;</li>
<li>&#x4F7F;&#x7528;&#x7F29;&#x8FDB;&#x8868;&#x793A;&#x5C42;&#x7EA7;&#x5173;&#x7CFB;</li>
<li>&#x7F29;&#x8FDB;&#x65F6;&#x4E0D;&#x5141;&#x8BB8;&#x4F7F;&#x7528;Tab&#x952E;&#xFF0C;&#x53EA;&#x5141;&#x8BB8;&#x4F7F;&#x7528;&#x7A7A;&#x683C;&#x3002;</li>
<li>&#x7F29;&#x8FDB;&#x7684;&#x7A7A;&#x683C;&#x6570;&#x76EE;&#x4E0D;&#x91CD;&#x8981;&#xFF0C;&#x53EA;&#x8981;&#x76F8;&#x540C;&#x5C42;&#x7EA7;&#x7684;&#x5143;&#x7D20;&#x5DE6;&#x4FA7;&#x5BF9;&#x9F50;&#x5373;&#x53EF;</li>
<li>&#x4E95;&#x53F7;&#x8868;&#x793A;&#x6CE8;&#x91CA;&#xFF0C;&#x4ECE;&#x8FD9;&#x4E2A;&#x5B57;&#x7B26;&#x4E00;&#x76F4;&#x5230;&#x884C;&#x5C3E;&#xFF0C;&#x90FD;&#x4F1A;&#x88AB;&#x89E3;&#x6790;&#x5668;&#x5FFD;&#x7565;&#x3002;</li>
</ul>
<h2 id="t23. YAML &#x652F;&#x6301;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;">3. YAML &#x652F;&#x6301;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784; <a href="#t23. YAML &#x652F;&#x6301;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;"> # </a></h2>
<ul>
<li>&#x5BF9;&#x8C61;&#xFF1A;&#x952E;&#x503C;&#x5BF9;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x53C8;&#x79F0;&#x4E3A;&#x6620;&#x5C04;&#xFF08;mapping&#xFF09;/ &#x54C8;&#x5E0C;&#xFF08;hashes&#xFF09; / &#x5B57;&#x5178;&#xFF08;dictionary&#xFF09;</li>
<li>&#x6570;&#x7EC4;&#xFF1A;&#x4E00;&#x7EC4;&#x6309;&#x6B21;&#x5E8F;&#x6392;&#x5217;&#x7684;&#x503C;&#xFF0C;&#x53C8;&#x79F0;&#x4E3A;&#x5E8F;&#x5217;&#xFF08;sequence&#xFF09; / &#x5217;&#x8868;&#xFF08;list&#xFF09;</li>
<li>&#x7EAF;&#x91CF;&#xFF08;scalars&#xFF09;&#xFF1A;&#x5355;&#x4E2A;&#x7684;&#x3001;&#x4E0D;&#x53EF;&#x518D;&#x5206;&#x7684;&#x503C;</li>
</ul>
<h3 id="t33.1 &#x5BF9;&#x8C61;">3.1 &#x5BF9;&#x8C61; <a href="#t33.1 &#x5BF9;&#x8C61;"> # </a></h3>
<p>&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x7EC4;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x4F7F;&#x7528;&#x5192;&#x53F7;&#x7ED3;&#x6784;&#x8868;&#x793A;&#x3002;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">name:</span> <span class="hljs-string">zfpx</span>
</code></pre>
<p>&#x8F6C;&#x4E3A; JavaScript &#x5982;&#x4E0B;&#x3002;</p>
<pre><code class="lang-js">{ <span class="hljs-attr">name</span>: <span class="hljs-string">&apos;zfpx&apos;</span> }
</code></pre>
<h3 id="t43.2 &#x6570;&#x7EC4;">3.2 &#x6570;&#x7EC4; <a href="#t43.2 &#x6570;&#x7EC4;"> # </a></h3>
<p>&#x4E00;&#x7EC4;&#x8FDE;&#x8BCD;&#x7EBF;&#x5F00;&#x5934;&#x7684;&#x884C;&#xFF0C;&#x6784;&#x6210;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-yaml"><span class="hljs-bullet">-</span> <span class="hljs-string">apple</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">banana</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">orange</span>
</code></pre>
<p>&#x8F6C;&#x4E3A; JavaScript &#x5982;&#x4E0B;</p>
<pre><code class="lang-js">[ <span class="hljs-string">&apos;apple&apos;</span>, <span class="hljs-string">&apos;banana&apos;</span>, <span class="hljs-string">&apos;orange&apos;</span> ]
</code></pre>
<h3 id="t53.3 &#x590D;&#x5408;&#x7ED3;&#x6784;">3.3 &#x590D;&#x5408;&#x7ED3;&#x6784; <a href="#t53.3 &#x590D;&#x5408;&#x7ED3;&#x6784;"> # </a></h3>
<p>&#x5BF9;&#x8C61;&#x548C;&#x6570;&#x7EC4;&#x53EF;&#x4EE5;&#x7ED3;&#x5408;&#x4F7F;&#x7528;&#xFF0C;&#x5F62;&#x6210;&#x590D;&#x5408;&#x7ED3;&#x6784;&#x3002;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">name:</span> <span class="hljs-string">&apos;zfpx&apos;</span>
<span class="hljs-attr">age:</span> <span class="hljs-number">18</span>
<span class="hljs-attr">score:</span>
<span class="hljs-attr">  chinese:</span> <span class="hljs-number">80</span>
<span class="hljs-attr">  math:</span> <span class="hljs-number">90</span>
<span class="hljs-attr">  english:</span> <span class="hljs-number">100</span>
</code></pre>
<pre><code class="lang-js">{
    <span class="hljs-attr">name</span>: <span class="hljs-string">&apos;zfpx&apos;</span>,
    <span class="hljs-attr">age</span>: <span class="hljs-number">18</span>,
    <span class="hljs-attr">score</span>:
    {
        <span class="hljs-attr">chinese</span>:<span class="hljs-number">80</span>,
        <span class="hljs-attr">math</span>:<span class="hljs-number">90</span>,
        <span class="hljs-attr">english</span>:<span class="hljs-number">100</span>
    }
}
</code></pre>
<h3 id="t63.4 &#x7EAF;&#x91CF;">3.4 &#x7EAF;&#x91CF; <a href="#t63.4 &#x7EAF;&#x91CF;"> # </a></h3>
<p>&#x7EAF;&#x91CF;&#x662F;&#x6700;&#x57FA;&#x672C;&#x7684;&#x3001;&#x4E0D;&#x53EF;&#x518D;&#x5206;&#x7684;&#x503C;&#x3002;&#x4EE5;&#x4E0B;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x90FD;&#x5C5E;&#x4E8E; JavaScript &#x7684;&#x7EAF;&#x91CF;&#x3002;</p>
<ul>
<li>&#x5B57;&#x7B26;&#x4E32;</li>
<li>&#x5E03;&#x5C14;&#x503C;</li>
<li>&#x6574;&#x6570;</li>
<li>&#x6D6E;&#x70B9;&#x6570;</li>
<li>Null</li>
<li>&#x65F6;&#x95F4;</li>
<li>&#x65E5;&#x671F;</li>
</ul>
<pre><code class="lang-yaml"><span class="hljs-attr">name:</span> <span class="hljs-string">&apos;zfpx&apos;</span>
<span class="hljs-attr">age:</span> <span class="hljs-number">10</span>
<span class="hljs-attr">score:</span> <span class="hljs-number">99.99</span>
<span class="hljs-attr">married:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">parent:</span> <span class="hljs-string">~</span>
<span class="hljs-attr">now:</span> <span class="hljs-number">1982</span><span class="hljs-bullet">-09</span><span class="hljs-bullet">-03</span><span class="hljs-attr">T22:22:22.10-09:00</span>
<span class="hljs-attr">birthday:</span> <span class="hljs-number">1982</span><span class="hljs-bullet">-09</span><span class="hljs-bullet">-03</span> 
</code></pre>
<h2 id="t7&#x53C2;&#x8003;">&#x53C2;&#x8003; <a href="#t7&#x53C2;&#x8003;"> # </a></h2>
<ul>
<li><a href="https://github.com/nodeca/js-yaml">js-yaml</a></li>
<li><a href="http://nodeca.github.io/js-yaml/">&#x5728;&#x7EBF;DEMO</a></li>
<li><a href="http://www.ruanyifeng.com/blog/2016/07/yaml.html">yaml</a></li>
</ul>

        <div class="copyright">Powered by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a>. Dependence <a href="https://nodejs.org">Node.js</a> run.</div>
    </div>
    
</div>

<script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.js"></script>
<script>
$('.warpper .page-toc ul ul li a').on('click',function(){
  $('.warpper .page-toc ul ul li a').removeClass('my-active')
  $(this).addClass('my-active')
})
  // if (!$('.understand-me').length) {
  //   var bar = $(window).height() - $('.navbar ').height() - $('.page-toc').position().top;
  //   var count = bar / 26 / 2;
  //   var barHeight = $('.page-toc').outerHeight();
  //   $('.page-toc li').eq(0).children('a').addClass('red');
  //   var arr = [];
  //   $("h1,h2,h3,h4,h5,h6").each(function () {
  //     arr.push($(this).position().top);
  //   });
  //   var timer
  //   function dark() {
  //     clearTimeout(timer)
  //      timer = setTimeout(function () {
  //      var top = Math.abs($('.page-toc > ul').position().top);
  //      var cur = $('.content').scrollTop();
  //      for (var i = arr.length; i >= 0; i--) {
  //        if (arr[i] <= cur) {
  //          break;
  //        }
  //      }
  //      if (i === -1) {
  //        i = 0;
  //      }
  //      $('.page-toc li a').removeClass('red');
  //      $('.page-toc li').eq(i).children('a').addClass('red');
  //      let height = $('.page-toc li').eq(i).position().top-$('.page-toc').height(); // 如果当前的offset出去了 回到中间可好？
  //      $('.page-toc').scrollTop(height+$('.page-toc').height()/2);
  //    },200)
  //   }

  //   $('.content').on('scroll', dark);
  // }
</script>
<style>

    /* ::-webkit-scrollbar{width:14px;}
    ::-webkit-scrollbar-track{background-color:transparent;}
    ::-webkit-scrollbar-thumb{background-color:transparent;}
    ::-webkit-scrollbar-thumb:hover {background-color:transparent}
    ::-webkit-scrollbar-thumb:active {background-color:transparent} */

    .page-toc > ul .red {
        background: #f3f3f3;
        z-index: 1;
        border-left: 3px solid #009a61;
        -webkit-transition: all .2s ease;
        transition: all .2s ease;
        color: #000
    }





</style>
</body>
</html>
